<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 算数计算中的自动转换+，-
        // 在算术计算中先将数据转换为number,再计算
        var a = true;
        var b = "13";
        var c = b-a;
        /* var c = Number(b)-Number(a) */
        console.log(c)  // 输出12
        
    </script>
</body>
</html>